with System; use System;

package body IO is

   procedure Write_Network_Byte_Order(Stream : not null access Ada.Streams.Root_Stream_Type'Class; Item : in Word_16) is
      begin
      if Default_Bit_Order = High_Order_First then
         Unsigned_16'Write(Stream, Unsigned_16(Item));
         return;
      end if;
      Byte_Type'Write(Stream, Byte_Type( Shift_Right(Item, 8)));
      Byte_Type'Write(Stream, Byte_Type(Item and 16#00FF#));
      --Word_16_Network'Write(Stream, Word_16_Network((Item mod 256) * 256 + (Item/256)));
   end Write_Network_Byte_Order;
end IO;